package com.xyw.code.study20200813.rest;

import com.alibaba.fastjson.JSONObject;
import com.xyw.code.study20200813.cache.UserCache;
import com.xyw.code.study20200813.dao.SysUserMapper;
import com.xyw.code.study20200813.dao.UsersMapper;
import com.xyw.code.study20200813.po.SysUser;
import com.xyw.code.study20200813.po.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.sql.Timestamp;
import java.util.Date;
import java.util.HashSet;

/**
 * Created with IntelliJ IDEA.
 * User: xuyiwei
 * Date: 2020/8/13
 * Time: 上午10:25
 * Email: 1328312923@qq.com
 * Description: No Description
 **/
@RestController
public class UsersController {

    @Resource
    private UsersMapper usersMapper;

    @RequestMapping("test")
    public void test() {
        for (int i = 0; i < 500000; i++) {
            long time = System.currentTimeMillis();
            usersMapper.saveUsers(Users.builder().timeDate(new Date(time)).timeLong(time).timeTimestamp(new Timestamp(time)).build());
        }
    }

    public static void main(String[] args) {
        Integer i1 = 33;
        Integer i2 = 33;
        System.out.println(i1 == i2);// 输出 true
        Integer i11 = 127;
        Integer i22 = 127;
        System.out.println(i11 == i22);// 输出 false
        Double i3 = 1.2;
        Double i4 = 1.2;
        System.out.println(i3 == i4);// 输出 false
    }
}
